package belf.migrate.api.common;

import java.util.HashMap;
import java.util.Map;

public class DatabaseCompatibility {
    private static Map<String, String> mapping = new HashMap<>();
    static {
        mapping.put(DatabaseIdentifier.DAMENG, "Oracle");
        mapping.put(DatabaseIdentifier.GBASE_8S, "Oracle");
        mapping.put(DatabaseIdentifier.SHENTONG, "Oracle");
        mapping.put(DatabaseIdentifier.OPENGAUSS, "PostgreSQL");
        mapping.put(DatabaseIdentifier.GAUSSDB, "PostgreSQL");
        mapping.put(DatabaseIdentifier.OCEANBASE, "PostgreSQL");
        mapping.put(DatabaseIdentifier.HIGHGO, "PostgreSQL");
        mapping.put(DatabaseIdentifier.TIDB, "MySQL");
        mapping.put(DatabaseIdentifier.GOLDENDB, "MySQL");
    }

    public static String name(String dbIdentifier) {
        if (mapping.containsKey(dbIdentifier)) {
            return mapping.get(dbIdentifier);
        }
        return DatabaseIdentifier.name(dbIdentifier);
    }
}
